import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';

class CustomAvatar extends StatelessWidget {
  final double width, height;
  final String netPath;

  const CustomAvatar(
      {super.key,
      required this.width,
      required this.height,
      required this.netPath});

  @override
  Widget build(BuildContext context) {
    return ClipOval(
        child:
        CachedNetworkImage(imageUrl: netPath,
        width: width,height: height,errorWidget: (context,url,error)=> Container(
            width: width,
            height: height,
            color: Colors.grey,
            alignment: Alignment.center,
            child: const Icon(
              Icons.error,
              color: Colors.white,
            ),
          ),)
    );
  }
}
